package clinica;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JMenuItem;

public class Principal extends JFrame {

	private JPanel contentPane;
	private CadVeterinario cadastroVeterinario= new CadVeterinario();
	private CadCliente cadastroCliente= new CadCliente();

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Principal frame = new Principal();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Principal() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JMenuBar mnbBarra = new JMenuBar();
		mnbBarra.setBounds(0, 0, 442, 21);
		contentPane.add(mnbBarra);
		
		JMenu mnCadastar = new JMenu("Cadastar");
		mnbBarra.add(mnCadastar);
		
		JMenuItem mnCliente = new JMenuItem("Cliente");
		mnCliente.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				
				cadastroCliente.setVisible(true);
				
			}
		});
		mnCadastar.add(mnCliente);
		
		JMenuItem mnVeterinario = new JMenuItem("Veterinario");
		mnVeterinario.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			
				cadastroVeterinario.setVisible(true);
				
			}
		});
		mnCadastar.add(mnVeterinario);
	}
}
